package com.ruoyi.hr.common.utils;


import com.ruoyi.hr.domain.HrOperateLog;
import com.ruoyi.hr.domain.dto.HrLogAddDto;

public class BaseThreadLocal {
	private static final ThreadLocal<Long> userIdLocal = new ThreadLocal<>();
	private static final ThreadLocal<HrLogAddDto> hrLogLocal = new ThreadLocal<>();
	private static final ThreadLocal<String> userNameLocal = new ThreadLocal<>();


	public static void setUserId(Long userId){
		userIdLocal.set(userId);
	}
	public static Long getUserId(){
		return userIdLocal.get();
	}
	public static void removeUserId(){
		userIdLocal.remove();
	}

	public static void setUserName(String userName){
		userNameLocal.set(userName);
	}
	public static String getUserName(){
		return userNameLocal.get();
	}
	public static void removeUserName(){
		userNameLocal.remove();
	}

	public static void setHrLog(HrLogAddDto hrLog){
		hrLogLocal.set(hrLog);
	}
	public static HrLogAddDto getHrLog(){
		return hrLogLocal.get();
	}
	public static void removeHrLog(){
		hrLogLocal.remove();
	}
}
